<?php
	require_once $_SERVER['rootplateforme']."/classes/ConnectToBD_cmix.class.php";
	
	session_start();
	setcookie("PHPSESSID", session_id(), time()-42000, "/");//, "false", -42000, "/", "www.cmix.com");
	setcookie("cmix", session_id(), time()-42000, "/", "cmix.com", true);
	setcookie("login", $_SESSION['login'], time()-42000, "/", "cmix.com", true);
	setcookie("trusted", true, time()-42000, "/", "cmix.com", true);
	session_unset();
	session_destroy();
	setcookie("error", "Vous avez bien ete deconnecte.", time()+3, "/", "cmix.com");
	
	$idcon=ConnectToBD_cmix::connexion();
	$requete = "UPDATE utilisateur SET ip_addr='0' ,session_id='0' WHERE login='".$_SESSION['login']."';";
	$result=$idcon->prepare($requete);
	$result->execute();
	
		
	header("Location:".$_SERVER['plateforme']."/index.php");
?>